classes = {
'Session': (session_required,),
- 'Host': (valid_host, session_required),
- 'Host_CPU': (valid_host_cpu, session_required),
+ 'host': (valid_host, session_required),
+ 'host_cpu': (valid_host_cpu, session_required),
'VM': (valid_vm, session_required),
'VBD': (valid_vbd, session_required),
'VIF': (valid_vif, session_required)}
# Xen API: Class Host
# ----------------------------------------------------------------
- Host_attr_ro = ['software_version',
+ host_attr_ro = ['software_version',
'resident_VMs',
'host_CPUs']
- Host_attr_rw = ['name_label',
+ host_attr_rw = ['name_label',
'name_description']
- Host_methods = ['disable',
+ host_methods = ['disable',
'enable',
'reboot',
'shutdown']
- Host_funcs = ['get_by_label']
+ host_funcs = ['get_by_label']
# attributes
def host_get_name_label(self, session, host_ref):
# Xen API: Class Host_CPU
# ----------------------------------------------------------------
- Host_CPU_attr_ro = ['host',
+ host_cpu_attr_ro = ['host',
'number',
'features',
'utilisation']
'otherconfig'
]
+# configuration params that need to be converted to ints
+# since the XMLRPC transport for Xen API does not use
+# 32 bit ints but string representation of 64 bit ints.
+XENAPI_INT_CFG = [
+ 'user_version',
+ 'vcpus_number',
+ 'memory_static_min',
+ 'memory_static_max',
+ 'memory_dynamic_min',
+ 'memory_dynamic_max',
+ 'tpm_instance',
+ 'tpm_backend',
+]
+
##
## Xend Configuration Parameters
##
for cfgkey, apikey in LEGACY_CFG_TO_XENAPI_CFG.items():
try:
- cfg[cfgkey] = xenapi_vm[apikey]
+ if apikey in XENAPI_INT_CFG:
+ cfg[cfgkey] = int(xenapi_vm[apikey])
+ else:
+ cfg[cfgkey] = xenapi_vm[apikey]
except KeyError:
pass